<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="2" />
<title>项目单位</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中     -->
<script>
	$(document).ready(function() {
		 //验证
		 $("#inputForm").validate({
			 rules:{
				 entrustorgid:{
					 required:true,
					 checkProj : ["${ctx}/project/relationship!findByRelationProjName.action","#projId"]
				 }
			 }
		 });
		 
		 if(${ not empty id}){
			  alert("添加成功,本窗口将在3秒后关闭!");
			  window.parent.setProjName('${id}','${entrustorgid}','${witnessorgid}','${proj.projName}', '${witnesses}', '${wphone}', '${operations}',
						'${ophone}', '${checkpeople}', '${checkphone}');
			  setTimeout('$(window.parent.close()); ',3000);
		 }
	});
	function deletedesign(url){
		$.ajax({
			   type: "POST",
			   url: url,
			   success: function(msg){
				   if(msg=="1"){
					  alert("新增成功!");
					  window.returnValue=true;
					  window.close();
				   }else{
					  alert("新增失败!");
				   }
			   }
			});
	}
	</script>
</head>
<body>
<form action="${ctx}/project/relationship!save.action" method="post" id="inputForm"
	class='yform' enctype="multipart/form-data">
<div id="caption" ><h6>项目单位</h6></div>
<table class="noborder">
	<tr class="type-title">
	</tr>
	<tr class="type-text">
		<td>工程</td>
		<td colspan="3">
		<c:if test="${empty id }">
			<s:select id="projId" list="projList" name="info.id" listKey="id" listValue="projName"></s:select> 
		</c:if>
		<c:if test="${not empty id }">
			<input name="projName" value="${proj.projName}" readonly="readonly"/>
			<input id="projId" type="hidden" name="info.id" value="${proj.id}" readonly="readonly"/>
		</c:if>
		</td>
	</tr>
	<tr>	
		<td>委托单位</td>
		<td colspan="3">
		<input type="hidden"  name="id" value="${id}"/>	
		<input type="text" id="entrustorgid" name="entrustorgid" value="${entrustorgid}"/></td>
	</tr>
	<tr>
		<td>见证单位</td>
		<td colspan="3"><input type="text" name="witnessorgid" value="${witnessorgid}" /></td>
	</tr>
	<tr>	
		<td>见证人</td>
		<td><input type="text" name="witnesses" value="${witnesses}" /></td>
		<td>见证人联系电话</td>
		<td><input type="text" name="wphone" value="${wphone}" /></td>
	</tr>
	<tr>
		<td>委托送样人</td>
		<td><input type="text" name="operations" value="${operations}" /></td>
		<td>委托人联系电话</td>
		<td><input type="text" name="ophone" value="${ophone}" /></td>
	</tr>
		<tr>
		<td>抽检人</td>
		<td><input type="text" name="checkpeople" value="${checkpeople}" /></td>
		<td>抽检人联系电话</td>
		<td><input type="text" name="checkphone" value="${checkphone}" /></td>
	</tr>
</table>
<div class="type-button"><input   type="submit"
	class="submit" value="提交" />&nbsp;</div>
</form>
</body>
</html>
